﻿<input type="button" class="searchButton" id="searchButton"   value="Мы найдем!" />
<br /><br />
<div class="orange" ><a href="#"  class="sw" >[<span id="switch" class="switch">+</span>]Дополнительно</a></div>
<div class="additional">
<h3>Дополнительная информация</h3>
<textarea class="textarea" id="textarea" cols="50" rows="6" style="overflow: hidden;" ></textarea><br /><br />
</div>

<script>
    /**************/
    $('.additional').animate({opacity: "0"}, 0);
       $('.searchButton').click(function(){
        alert(document.getElementById('textBox').value);
        alert(document.getElementById('textarea').value);
        $.ajax({
            type: "POST",
            url: "/scripts/input.php",
            data:"query="+document.getElementById('textBox').value+"&body="+document.getElementById('textarea').value,
            success: function(msg){
             alert( "Data Saved: " + msg );
                 },
            error: function(){
                alert('error');
            }     
            
        }); 
         });
         
         
         $('.sw').hover(function(){
            $(this).css('cursor','pointer');
              }, function() {
               $(this).css('cursor','auto');
         });
       $('.sw').click(function(){
        if(document.getElementById("switch").innerHTML == '+')
         {
           $('.switch').html('-');
           $('.additional').animate({opacity: "1"}, 500);
         }
        else
         {
           $('.switch').html('+');
           $('.additional').animate({opacity: "0"}, 200);
         }
           
           
          
       });
       
    /***************/
           
</script>